package com.huawei.service;

import org.omg.Messaging.SYNC_WITH_TRANSPORT;

public class StoneScissorClothImpl implements StoneScissorCloth {
    @Override
    public int gameStandard(int computer, int person) {
        //0-输了，1-赢了，2-平局
        int result=0;
        switch (computer){
        case 0:
            if(person==0){
                result=2;
                System.out.println("人-平局");
            }else if(person==1){
                result= 0;
                System.out.println("人-输了");
            }else if(person==2){
                result=1;
                System.out.println("人-赢了");
            }
            break;
            case 1:
                if(person==0){
                result=1;
                System.out.println("人-赢");
            }else if(person==1){
                result= 2;
                System.out.println("人-平局");
            }else if(person==2) {
                    result = 0;
                    System.out.println("人-输了");
                }
                break;
            case 2:
                if(person==0){
                    result=0;
                    System.out.println("人-输了");
                }else if(person==1){
                    result= 1;
                    System.out.println("人-赢了");
                }else if(person==2) {
                    result = 2;
                    System.out.println("人-平局");
                    break;
                }
        }
        return 0;
    }
}


